package xyz.migle.sc;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Component
public class TestSchedu {
    private static final Logger logger = LoggerFactory.getLogger(TestSchedu.class);

    //@Scheduled(cron="0 */1 * * * ?")
    @Scheduled(cron="*/5 * * * * ?")
    public void sayHi(){
        logger.error("HELLO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!:" + LocalDateTime.now().toString());
    }
    //@Scheduled(fixedRate = 300000)
    @Scheduled(fixedRate = 5000)
    public void sayHi2(){
        logger.error("HELLO2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!:" + LocalDateTime.now().toString());

    }
}
